using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;
using System.Windows.Forms;


namespace @SolutionName
{
    /// <summary>
    /// The ActivityDesigner class is used to control the physical layout of the 
    /// Activity in the Visual Studio workflow designer.  It controls the size and placement
    /// of the rectangles bounding the Activity elements.
    /// </summary>
    [Serializable]
    [ActivityDesignerTheme(typeof(@ClassNameDesignerTheme))]
    class @ClassNameDesigner : SequentialActivityDesigner
	{
        ActivityDesignerVerb verbAbout; 
        
         protected override void Initialize(Activity activity)
        {
            base.Initialize(activity);
            Bitmap img = @SolutionName.Properties.Resources.ActivityLogo;
            this.Image = img;
             
            verbAbout = new ActivityDesignerVerb(this, DesignerVerbGroup.Edit, "About", new EventHandler(ShowAboutHandler));
            Verbs.Add(verbAbout);
        }

        private void ShowAboutHandler(object sender, EventArgs e)
        {
            MessageBox.Show("Sample Activity\r\n\r\n (c) 2008, Mann Software, LLC.\r\n", "About", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        
        protected override Size OnLayoutSize(ActivityDesignerLayoutEventArgs e)
        {
            base.OnLayoutSize(e);
            return new Size(150, 45);
        }

        protected override Rectangle ImageRectangle
        {
            get
            {
                Rectangle rectActivity = this.Bounds;
                Size size = new Size(20, 20);
                Rectangle rectImage = new Rectangle();
                rectImage.X = rectActivity.Left + 5;
                rectImage.Y = rectActivity.Top + ((rectActivity.Height - size.Height) / 2);
                rectImage.Width = size.Width;
                rectImage.Height = size.Height;
                return rectImage;
            }
        }

        protected override Rectangle TextRectangle
        {
            get
            {
                Rectangle rectActivity = this.Bounds;
                Size size = new Size(130, 40);
                Rectangle rectText = new Rectangle();
                rectText.X = this.ImageRectangle.Right + 5;
                rectText.Y = rectActivity.Top + 2;
                rectText.Size = size;
                return rectText;
            }
        }


	}
}
